home *** CD-ROM | disk | FTP | other *** search
- import java.io.IOException;
- import javax.microedition.lcdui.Canvas;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Font;
- import javax.microedition.lcdui.Graphics;
- import javax.microedition.lcdui.Image;
-
- public class StartForm extends Canvas implements CommandListener {
- Datum midlet;
- Image logo;
-
- public StartForm(Datum midlet) {
- this.midlet = midlet;
- ((Displayable)this).setCommandListener(this);
- Command selectLangCommand = new Command("Start", 1, 0);
- Command selectInfoCommand = new Command("Info", 1, 0);
- Command exitCommand = new Command("Schließen", 1, 0);
- ((Displayable)this).addCommand(selectLangCommand);
- ((Displayable)this).addCommand(selectInfoCommand);
- ((Displayable)this).addCommand(exitCommand);
-
- try {
- this.logo = Image.createImage("/images/logo_max.png");
- } catch (IOException var6) {
- }
-
- }
-
- public void paint(Graphics g) {
- g.setGrayScale(255);
- g.fillRect(0, 0, ((Canvas)this).getWidth(), ((Canvas)this).getHeight());
- g.setGrayScale(0);
- g.drawImage(this.logo, 10, 0, 0);
- g.setFont(Font.getFont(0, 0, 8));
- g.drawString(this.midlet.appName, 10, 45, 0);
- g.drawString("engelrico.de", 10, 55, 0);
- g.drawString("(c) R. Engelmann", 10, 65, 0);
- }
-
- public void commandAction(Command command, Displayable displayable) {
- if (command.getLabel().equals("Schließen")) {
- this.midlet.destroyApp(true);
- }
-
- if (command.getLabel().equals("Info")) {
- this.midlet.viewInfoForm();
- }
-
- if (command.getLabel().equals("Start")) {
- this.midlet.viewInputForm();
- }
-
- }
- }
-